package facade.bean;

import java.util.List;

import javax.inject.Inject;

import service.LeagueService;

import common.Mapper;

import facade.LeagueFacade;
import facade.dto.LeagueDTO;

public class LeagueFacadeBean implements LeagueFacade {

	@Inject
	private LeagueService service;
	
	@Inject
	private Mapper mapper;
	
	@Override
	public LeagueDTO getLeague(Long id) {
		return mapper.map(service.get(id), LeagueDTO.class);
	}

	@Override
	public List<LeagueDTO> getAllLeagues() {
		return mapper.mapList(service.getAll(), LeagueDTO.class);
	}

}
